function maxLong(str1, str2) {
    if (
        str1 == null ||
        str2 == null ||
        str1.length == 0 ||
        str2.length == 0
    ) {
        return 0;
    }
    let max = 0;
    let dp = [];
    for (let i = 0; i < str2.length + 1; i++) {
        dp[i] = 0;
    }
    //
    for (let i = 1; i <= str1.length; i++) {
        for (let j = str2.length; j >= 1; j--) {
            if (str1.charAt(i - 1) === str2.charAt(j - 1)) {
                dp[j] = dp[j - 1] + 1;
            } else {
                dp[j] = 0;
            }
            max = Math.max(max, dp[j]);
        }
    }
    console.log(dp);
    return max;
}